package com.aistar.service.impl;

import com.aistar.mapper.ProjectExperienceMapper;
import com.aistar.pojo.ProjectExperience;
import com.aistar.pojo.ProjectExperienceExample;
import com.aistar.service.ProjectExperienceService;
import com.aistar.util.MyBatisUtil;
import com.aistar.util.ServerResponse;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class ProjectExperienceImpl implements ProjectExperienceService {
    @Override
    public ServerResponse getAllByResumeId(Integer resumeId) {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        ProjectExperienceMapper mapper =   sqlSession.getMapper(ProjectExperienceMapper.class);
        ProjectExperienceExample experienceExample = new ProjectExperienceExample();

        experienceExample.createCriteria().andResumeIdEqualTo(resumeId).andStatusEqualTo(0);

        List<ProjectExperience> projectExperienceList =  mapper.selectByExample(experienceExample);
        if(projectExperienceList!=null && projectExperienceList.size() >0)
            return ServerResponse.getDataSuccess(projectExperienceList);
        return ServerResponse.getDataFailed("暂无项目经验");
    }

    @Override
    public ServerResponse save(ProjectExperienceService projectExperience) {
        return null;
    }

    @Override
    public ServerResponse modifyStatus(ProjectExperienceService projectExperience) {
        return null;
    }

    @Override
    public ServerResponse modify(ProjectExperienceService projectExperience) {
        return null;
    }

    @Override
    public ServerResponse getById(Integer id) {
        return null;
    }

    @Override
    public ServerResponse getAll() {
        return null;
    }
}
